
********************************************************************************
* Set Stata parameters and define directories
********************************************************************************
clear
clear all
clear matrix
cap log close
set mem 200m
set more off, permanently
set maxvar 15000
set matsize 10000
set emptycells drop, permanently
set type double

version 16
set seed 348399

global loadpackages = 0

* API key
global key = "32d1e98cfad74b7eb9748d08d6f4e405"


global dir "E:/ReplicateBuild"
global data "$dir/01_data" 
global rawdata = "E:/01_data/01_raw"
global basedata = "$data/02_basedata"
global intdata= "$data/03_intermediate"
global auxdata = "$data/04_auxiliary"
global temp = "$data/05_temp"
global code = "$dir/02_code"
global analysis = "$code/03_analyze"
global output = "$dir/03_output"
global tables = "$output/tables"
global figures = "$output/figures"

if $loadpackages == 1 {
local required_ados " unique blindschemes opencagegeo insheetjson libjson geodist estout sg97_5 tabout reghdfe ftools coefplot vam scat3 eventstudyinteract avar" //add the required ados here// 
foreach x of local required_ados {
	capture findfile `x'.ado		
	if _rc==601 {
		ssc install `x'
	}
}

net install corrtex.pkg



}

set scheme plotplain, perm